﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Olemas.DataModels;
using Olemas.Models;
using Olemas.ViewModels;

namespace Olemas.Controllers
{
    public class FacultiesController : Controller
    {
        private FacultiesViewModel _facultiesViewModel;
        //
        // GET: /Faculties/

        /// <summary>
        /// Returns partial view of faculties to be used in the sidebar.
        /// </summary>
        public ActionResult Index(string action, string controller)
        {
            var faculties = FacultyModel.GetOrderedFaculties() as IEnumerable<Faculty>;
            _facultiesViewModel = new FacultiesViewModel(faculties, action, controller);

            return PartialView("_FacultiesSidebar", _facultiesViewModel);
        }

    }
}
